#include "bsp_init.h"

    uint8_t flag;
    int length;
    int data;

void bsp_init(void)
{
    //配置中断分组
    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);//0~15级抢占优先级，4bit用于抢占优先级，0bit用于子优先级
    //系统时钟配置
		SysTick_Configuration();
    //GPIO配置
    GPIO_Configure();
    //参考时钟配置
    TIM5_Configuration();
    //串口配置
    USART1_Configuration();
    USART2_Configuration();
    //USART3_Configuration();
    UART4_Configuration();
    UART5_Configuration();
    USART6_Configuration();
    delay_ms(100);
    //CAN配置
    CAN1_Configuration();
    CAN2_Configuration();
    //SDcard
    // SD_Init();
    // flag = SD_GetCID((uint8_t *)&data);
    // length = SD_GetSectorCount();
     /*看门狗，防止主控卡死*/
     IWDG_Init(IWDG_Prescaler_32,2047);
     delay_ms(100);

    delay_ms(100);
    
}
